package structure.map.test;

import structure.map.basic.MyMap;
import structure.map.basic.MyTreeMap;

/**
 * 项目名称: god
 * 包 名 称: com.map.test
 * 类 名 称: Main
 * 类 描 述: TODO
 * 创建时间: 2020/6/14 5:05 下午
 * 创 建 人: Justice
 */
public class Main {
    public static void main(String[] args) {
        MyTreeMap<Integer, String> myTreeMap = new MyTreeMap<Integer, String>();
        myTreeMap.put(1, "Jim");
        myTreeMap.put(2, "Tom");
        myTreeMap.put(1, "Ann");

//        System.out.println(myTreeMap.size());
//        System.out.println(myTreeMap.isEmpty());
//        System.out.println(myTreeMap.get(2));
//        System.out.println(myTreeMap.containsKey(1));
//        System.out.println(myTreeMap.containsValue("Tom"));
        myTreeMap.remove(2);
        myTreeMap.traversal(new MyMap.Visitor<Integer, String>() {
            @Override
            public boolean visit(Integer key, String value) {
                System.out.println(key + ":" + value);
                return false;
            }
        });
    }
}
